package com.greenhouse.business.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.greenhouse.business.domain.BizAlarmLog;
import com.greenhouse.business.domain.vo.AlarmStatisticVo;
import com.greenhouse.business.mapper.BizAlarmLogMapper;
import com.greenhouse.business.service.IBizAlarmLogService;

/**
 * 报警日志Service业务层处理
 * 
 * @author greenhouse
 * @date 2021-05-07
 */
@Service
public class BizAlarmLogServiceImpl implements IBizAlarmLogService {
	@Autowired
	private BizAlarmLogMapper bizAlarmLogMapper;

	/**
	 * 查询报警日志
	 * 
	 * @param id 报警日志ID
	 * @return 报警日志
	 */
	@Override
	public BizAlarmLog selectBizAlarmLogById(Long id) {
		return bizAlarmLogMapper.selectBizAlarmLogById(id);
	}

	/**
	 * 查询报警日志列表
	 * 
	 * @param bizAlarmLog 报警日志
	 * @return 报警日志
	 */
	@Override
	public List<BizAlarmLog> selectBizAlarmLogList(BizAlarmLog bizAlarmLog) {
		return bizAlarmLogMapper.selectBizAlarmLogList(bizAlarmLog);
	}

	/**
	 * 新增报警日志
	 * 
	 * @param bizAlarmLog 报警日志
	 * @return 结果
	 */
	@Override
	public int insertBizAlarmLog(BizAlarmLog bizAlarmLog) {
		return bizAlarmLogMapper.insertBizAlarmLog(bizAlarmLog);
	}

	/**
	 * 修改报警日志
	 * 
	 * @param bizAlarmLog 报警日志
	 * @return 结果
	 */
	@Override
	public int updateBizAlarmLog(BizAlarmLog bizAlarmLog) {
		return bizAlarmLogMapper.updateBizAlarmLog(bizAlarmLog);
	}

	/**
	 * 批量删除报警日志
	 * 
	 * @param ids 需要删除的报警日志ID
	 * @return 结果
	 */
	@Override
	public int deleteBizAlarmLogByIds(Long[] ids) {
		return bizAlarmLogMapper.deleteBizAlarmLogByIds(ids);
	}

	@Override
	public List<BizAlarmLog> listByDeviceId(Long id) {
		return bizAlarmLogMapper.selectBizAlarmLogListByDeviceId(id);
	}

	/**
	 * 删除报警日志信息
	 * 
	 * @param id 报警日志ID
	 * @return 结果
	 */
	@Override
	public int deleteBizAlarmLogById(Long id) {
		return bizAlarmLogMapper.deleteBizAlarmLogById(id);
	}

	@Override
	public List<BizAlarmLog> listByNum(int num) {
		// TODO Auto-generated method stub
		return bizAlarmLogMapper.listByNum(num);
	}

	@Override
	public List<AlarmStatisticVo> stasticAlarmByMonth() {
		// TODO Auto-generated method stub
		return bizAlarmLogMapper.stasticAlarmByMonth();
	}
}
